package com.operate.api.operate.version.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.operate.api.base.ApiIndex;
import com.operate.api.base.R;
import com.operate.api.operate.version.service.ISysVersionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;


@Api( tags = ApiIndex.SysVersionController)
@RequestMapping(value = "/api/sys/version")
@RestController
@SaCheckLogin
public class SysVersionController {
    @Autowired
    private ISysVersionService service;

    @ApiOperation(value = "更新前端页面")
    @PostMapping(value = "/update_web")
    @ResponseBody
    public R upload(
            @ApiParam(value = "文件【需要是zip包】", required = true) @RequestParam("file") MultipartFile file
    ) throws IOException {
        return service.updateWeb(file);
    }



}
